$(".address-bd .address-option .weui_switch1").click(function() {
    if ($(this).is(':checked')) {
        $(this).siblings(".ceng").hide();
		$(".elevator1").val("2");
		
    } else {
        $(this).siblings(".ceng").show();
		$(".elevator1").val("1");
    }
	Fb();
	chuanAjax();
});

$(".address-bd .address-option .weui_switch2").click(function() {
    if ($(this).is(':checked')) {
        $(this).siblings(".ceng").hide();
		$(".elevator2").val("2");
    } else {
        $(this).siblings(".ceng").show();
		$(".elevator2").val("1");
    }
	Fb();
	chuanAjax();
});
//

function getDate(dates){
	"use strict";
	var dd = new Date();
    dd.setDate(dd.getDate()+dates);
    var y = dd.getFullYear();
    var m = dd.getMonth()+1;
    var d = dd.getDate();
    
	return y+"-"+m+"-"+d;
}

function getMyWeek3(){
	"use strict";
	var week;
	var myDate;
	
	myDate = new Date();
    myDate.setDate(myDate.getDate()+3);
	
	switch (myDate.getDay()){
		case 0:
			week="周日";
			break;
		case 1:
			week="周一";
			break;
		case 2:
			week="周二";
			break;
		case 3:
			week="周三";
			break;
		case 4:
			week="周四";
			break;
		case 5:
			week="周五";
			break;
		case 6:
			week="周六";
			break;
	}
	return week;
}

function getMyWeek4(){
	"use strict";
	var week;
	var myDate;
	
	myDate = new Date();
    myDate.setDate(myDate.getDate()+4);
	
	switch (myDate.getDay()){
		case 0:
			week="周日";
			break;
		case 1:
			week="周一";
			break;
		case 2:
			week="周二";
			break;
		case 3:
			week="周三";
			break;
		case 4:
			week="周四";
			break;
		case 5:
			week="周五";
			break;
		case 6:
			week="周六";
			break;
	}
	return week;
}

function getMyWeek5(){
	"use strict";
	var week;
	var myDate;
	
	myDate = new Date();
    myDate.setDate(myDate.getDate()+5);
	
	switch (myDate.getDay()){
		case 0:
			week="周日";
			break;
		case 1:
			week="周一";
			break;
		case 2:
			week="周二";
			break;
		case 3:
			week="周三";
			break;
		case 4:
			week="周四";
			break;
		case 5:
			week="周五";
			break;
		case 6:
			week="周六";
			break;
	}
	return week;
}

function getMyWeek6(){
	"use strict";
	var week;
	var myDate;
	
	myDate = new Date();
    myDate.setDate(myDate.getDate()+6);
	
	switch (myDate.getDay()){
		case 0:
			week="周日";
			break;
		case 1:
			week="周一";
			break;
		case 2:
			week="周二";
			break;
		case 3:
			week="周三";
			break;
		case 4:
			week="周四";
			break;
		case 5:
			week="周五";
			break;
		case 6:
			week="周六";
			break;
	}
	return week;
}

function getMyWeek7(){
	"use strict";
	var week;
	var myDate;
	
	myDate = new Date();
    myDate.setDate(myDate.getDate()+7);
	
	switch (myDate.getDay()){
		case 0:
			week="周日";
			break;
		case 1:
			week="周一";
			break;
		case 2:
			week="周二";
			break;
		case 3:
			week="周三";
			break;
		case 4:
			week="周四";
			break;
		case 5:
			week="周五";
			break;
		case 6:
			week="周六";
			break;
	}
	return week;
}


$("#select-time").picker({
    title: "预约时间",
    toolbarCloseText: "确认",
    cols: [{
        textAlign: 'center',
        values: ['明天（'+getDate(1)+'）','后天（'+getDate(2)+'）',getMyWeek3()+'（'+getDate(3)+'）',getMyWeek4()+'（'+getDate(4)+'）',getMyWeek5()+'（'+getDate(5)+'）',getMyWeek6()+'（'+getDate(6)+'）',getMyWeek7()+'（'+getDate(7)+'）']
    }, {
        textAlign: 'center',
        values: ['早晨 07:00 - 09:00','上午 09:00 - 11:00', '中午 11:00 - 14:00', '下午 14:00 - 17:00', '傍晚 17:00 - 20:00']
    }],
    onClose: function() {
        $("#select-time").parent(".ban-item").addClass("on");
    }
});
$("#mudiceng").picker({
  title: "请选择楼层",
  cols: [
    {
      textAlign: 'center',
      values: ['1', '2', '3', '4', '5', '6', '7', '8']
    }
  ]
});
$("#chufaceng").picker({
  title: "请选择楼层",
  cols: [
    {
      textAlign: 'center',
      values: ['1', '2', '3', '4', '5', '6', '7', '8']
    }
  ]
});

$("#select-js").picker({
  title: "请选择数量",
  cols: [
    {
      textAlign: 'center',
      /*values: ['1','15到20件','20件以上']*/
	  values: ['1', '2', '3', '4', '5', '6', '7','8','9','10','11','12','13','14','15','15到20件','20件以上']
    }
  ]
});

$(".add").click(function() {
    var n = $(this).prev().val();
    var num = parseInt(n) + 1;
    if (num == 0) {
        return;
    } else {
        $(this).siblings(".jian").removeClass("hide");
        $(this).siblings(".num").removeClass("hide");
         if ($(this).parent().parent().siblings(".bd")) {
         	$(this).parent().parent().siblings(".bd").removeClass("hide");
         }
    }
    $(this).prev().val(num);
});


$(".jian").click(function() {
    var n = $(this).next().val();
    var num = parseInt(n) - 1;
    if (num == 0) {
		$(this).next().val(num);
    	$(this).addClass("hide");
        $(this).siblings(".num").addClass("hide");
        if ($(this).parent().parent().siblings(".bd")) {
		  $(this).parent().parent().siblings(".bd").addClass("hide");
	    }
        return
    }
    $(this).next().val(num);
});


$("#select-jj").click(function () {
	$("#page-home").hide();
	$("#page-upload-pic").hide();
	$("#page-select-dxl").fadeIn();
});



$("#upload-pic").click(function () {
	//$("#page-home").hide();
	$("#page-select-dxl").hide();
	$("#page-upload-pic").fadeIn();
});

$("#change_cart").click(function () {
	$("#page-home").hide();
	$("#page-select-car").fadeIn();
});

function back() {
	$("#page-select-dxl").hide();
	$("#page-select-car").hide();
	$("#page-home").fadeIn();
}
function jsbz() {
	$("#jsbz").removeClass('hide');
}
function close() {
	$("#jsbz").addClass('hide');
}

// 大件家具家电、更改车型回到页面
$(".jiaju-confirm").click(function() {
	var jiaju="";
	//包裹
	if( $(".baoguo1").val()!=0 ){
		jiaju="少于10个" +" "+ $(".baoguo1").val() + "、";
	}
	
	if( $(".baoguo2").val()!=0 ){
		jiaju=jiaju+"10-20个" +" "+ $(".baoguo2").val() + "、";
	}
	
	if( $(".baoguo3").val()!=0 ){
		jiaju=jiaju+"20-30个" +" "+ $(".baoguo3").val() + "、";
	}
	
	if( $(".baoguo4").val()!=0 ){
		jiaju=jiaju+"30个以上" +" "+ $(".baoguo4").val() + "、";
	}
	
	//洗衣机
	if( $(".xiyiji1").val()!=0 ){
		jiaju=jiaju+"普通洗衣机" +" "+ $(".xiyiji1").val() + "、";
	}
	
	if( $(".xiyiji2").val()!=0 ){
		jiaju=jiaju+"波轮洗衣机" +" "+ $(".xiyiji2").val() + "、";
	}
	
	if( $(".xiyiji3").val()!=0 ){
		jiaju=jiaju+"滚筒洗衣机" +" "+ $(".xiyiji3").val() + "、";
	}
	
	//冰箱
	if( $(".bingxiang1").val()!=0 ){
		jiaju=jiaju+"单门100L以下" +" "+ $(".bingxiang1").val() + "、";
	}
	
	if( $(".bingxiang2").val()!=0 ){
		jiaju=jiaju+"双门100L-200L" +" "+ $(".bingxiang2").val() + "、";
		
	}
	
	if( $(".bingxiang3").val()!=0 ){
		jiaju=jiaju+"三门200L-280L" +" "+ $(".bingxiang3").val() + "、";
	}
	
	if( $(".bingxiang4").val()!=0 ){
		jiaju=jiaju+"对开门280" +" "+ $(".bingxiang4").val() + "、";
	}
	
	if( $(".bingxiang5").val()!=0 ){
		jiaju=jiaju+"多开门" +" "+ $(".bingxiang5").val() + "、";
	}
	
	if( $(".bingxiang6").val()!=0 ){
		jiaju=jiaju+"冰柜" +" "+ $(".bingxiang6").val() + "、";
	}
	
	//电视
	if( $(".dianshi1").val()!=0 ){
		jiaju=jiaju+"50寸以下液晶" +" "+ $(".dianshi1").val() +$(".chai_dianshi1").val()+"、";
	}
	
	if( $(".dianshi2").val()!=0 ){
		jiaju=jiaju+"50-60寸液晶" +" "+ $(".dianshi2").val() +$(".chai_dianshi2").val()+"、";
	}
	
	if( $(".dianshi3").val()!=0 ){
		jiaju=jiaju+"60寸以上液晶" +" "+ $(".dianshi3").val()  +$(".chai_dianshi3").val()+"、";
	}
	
	//厨房电器
	if( $(".chufangdianqi1").val()!=0 ){
		jiaju=jiaju+"微波炉" +" "+ $(".chufangdianqi1").val() + "、";
	}
	
	if( $(".chufangdianqi2").val()!=0 ){
		jiaju=jiaju+"饮水机" +" "+ $(".chufangdianqi2").val() + "、";
	}
	
	if( $(".chufangdianqi3").val()!=0 ){
		jiaju=jiaju+"热水器" +" "+ $(".chufangdianqi3").val() + "、";
	}
	
	if( $(".chufangdianqi4").val()!=0 ){
		jiaju=jiaju+"烤箱" +" "+ $(".chufangdianqi4").val() + "、";
	}
	
	if( $(".chufangdianqi5").val()!=0 ){
		jiaju=jiaju+"燃气灶" +" "+ $(".chufangdianqi5").val() + "、";
	}
	
	//空调
	if( $(".kongtiao1").val()!=0 ){
		jiaju=jiaju+"一拖一壁挂" +" "+ $(".kongtiao1").val() +$(".chai_kongtiao1").val()+"、";
	}
	
	if( $(".kongtiao2").val()!=0 ){
		jiaju=jiaju+"一拖二壁挂" +" "+ $(".kongtiao2").val() +$(".chai_kongtiao2").val()+ "、";
	}
	
	if( $(".kongtiao3").val()!=0 ){
		jiaju=jiaju+"2匹柜机" +" "+ $(".kongtiao3").val() +$(".chai_kongtiao3").val()+ "、";
	}
	
	if( $(".kongtiao4").val()!=0 ){
		jiaju=jiaju+"3匹柜机" +" "+ $(".kongtiao4").val() +$(".chai_kongtiao4").val()+ "、";
	}
	
	if( $(".kongtiao5").val()!=0 ){
		jiaju=jiaju+"5匹柜机" +" "+ $(".kongtiao5").val() +$(".chai_kongtiao5").val()+ "、";
	}
	
	//床
	if( $(".chuang1").val()!=0 ){
		jiaju=jiaju+"单人床" +" "+ $(".chuang1").val() +$(".chai_chuang1").val()+ "、";
	}
	
	if( $(".chuang2").val()!=0 ){
		jiaju=jiaju+"双人床" +" "+ $(".chuang2").val() +$(".chai_chuang2").val()+ "、";
	}
	
	if( $(".chuang3").val()!=0 ){
		jiaju=jiaju+"双层儿童床" +" "+ $(".chuang3").val() +$(".chai_chuang3").val()+ "、";
	}
	
	if( $(".chuang4").val()!=0 ){
		jiaju=jiaju+"单人床垫" +" "+ $(".chuang4").val() + "、";
	}
	
	if( $(".chuang5").val()!=0 ){
		jiaju=jiaju+"双人床垫" +" "+ $(".chuang5").val() + "、";
	}
	
	if( $(".chuang6").val()!=0 ){
		jiaju=jiaju+"床头柜" +" "+ $(".chuang6").val() + "、";
	}
	
	
	//衣柜
	if( $(".yigui1").val()!=0 ){
		jiaju=jiaju+"推拉门衣柜" +" "+ $(".yigui1").val() +$(".chai_yigui1").val()+"、";
	}
	
	if( $(".yigui2").val()!=0 ){
		jiaju=jiaju+"两开门衣柜" +" "+ $(".yigui2").val() +$(".chai_yigui2").val()+"、";
	}
	
	if( $(".yigui3").val()!=0 ){
		jiaju=jiaju+"三开门衣柜" +" "+ $(".yigui3").val() +$(".chai_yigui3").val()+ "、";
	}
	
	if( $(".yigui4").val()!=0 ){
		jiaju=jiaju+"四开门衣柜" +" "+ $(".yigui4").val() +$(".chai_yigui4").val()+"、";
	}

	//其他柜子
	if( $(".qitaguizi1").val()!=0 ){
		jiaju=jiaju+"书柜" +" "+ $(".qitaguizi1").val() + "、";
	}
	
	if( $(".qitaguizi2").val()!=0 ){
		jiaju=jiaju+"电视柜" +" "+ $(".qitaguizi2").val() + "、";
	}
	
	if( $(".qitaguizi3").val()!=0 ){
		jiaju=jiaju+"鞋柜" +" "+ $(".qitaguizi3").val() + "、";
	}
	
	if( $(".qitaguizi4").val()!=0 ){
		jiaju=jiaju+"间厅柜" +" "+ $(".qitaguizi4").val() + "、";
	}
	
	if( $(".qitaguizi5").val()!=0 ){
		jiaju=jiaju+"酒柜" +" "+ $(".qitaguizi5").val() + "、";
	}
	
	if( $(".qitaguizi6").val()!=0 ){
		jiaju=jiaju+"其他小型柜子" +" "+ $(".qitaguizi6").val() + "、";
	}
	
	//茶几
	if( $(".chaji1").val()!=0 ){
		jiaju=jiaju+"木质茶几" +" "+ $(".chaji1").val() + "、";
	}
	
	if( $(".chaji2").val()!=0 ){
		jiaju=jiaju+"大理石茶几" +" "+ $(".chaji2").val() + "、";
	}
	
	if( $(".chaji3").val()!=0 ){
		jiaju=jiaju+"玻璃茶几" +" "+ $(".chaji3").val() + "、";
	}
	
	if( $(".chaji4").val()!=0 ){
		jiaju=jiaju+"其他茶几" +" "+ $(".chaji4").val() + "、";
	}
	
	//沙发
	if( $(".shafa1").val()!=0 ){
		jiaju=jiaju+"布艺沙发" +" "+ $(".shafa1").val() + "、";
	}
	
	if( $(".shafa2").val()!=0 ){
		jiaju=jiaju+"皮质沙发" +" "+ $(".shafa2").val() + "、";
	}
	
	if( $(".shafa3").val()!=0 ){
		jiaju=jiaju+"实木沙发" +" "+ $(".shafa3").val() + "、";
	}
	
	if( $(".shafa4").val()!=0 ){
		jiaju=jiaju+"红木沙发" +" "+ $(".shafa4").val() + "、";
	}
	
	if( $(".shafa5").val()!=0 ){
		jiaju=jiaju+"贵妃榻" +" "+ $(".shafa5").val() + "、";
	}

	//桌子
	if( $(".zhuozi1").val()!=0 ){
		jiaju=jiaju+"餐桌" +" "+ $(".zhuozi1").val() + "、";
	}
	
	if( $(".zhuozi2").val()!=0 ){
		jiaju=jiaju+"书桌" +" "+ $(".zhuozi2").val() + "、";
	}
	
	if( $(".zhuozi3").val()!=0 ){
		jiaju=jiaju+"电脑桌" +" "+ $(".zhuozi3").val() + "、";
	}
	
	if( $(".zhuozi4").val()!=0 ){
		jiaju=jiaju+"梳妆台" +" "+ $(".zhuozi4").val() + "、";
	}
	
	//钢琴
	if( $(".gangqin1").val()!=0 ){
		jiaju=jiaju+"型号120以下" +" "+ $(".gangqin1").val() + "、";
	}
	
	if( $(".gangqin2").val()!=0 ){
		jiaju=jiaju+"型号120-130" +" "+ $(".gangqin2").val() + "、";
	}
	
	if( $(".gangqin3").val()!=0 ){
		jiaju=jiaju+"型号130以上" +" "+ $(".gangqin3").val() + "、";
	}
	
	if( $(".gangqin4").val()!=0 ){
		jiaju=jiaju+"三角钢琴" +" "+ $(".gangqin4").val() + "、";
	}
	
	//健身器/按摩椅
	if( $(".jianshenqi1").val()!=0 ){
		jiaju=jiaju+"健身器" +" "+ $(".jianshenqi1").val() + "、";
	}
	
	if( $(".jianshenqi2").val()!=0 ){
		jiaju=jiaju+"跑步机" +" "+ $(".jianshenqi2").val() + "、";
	}
	
	if( $(".jianshenqi3").val()!=0 ){
		jiaju=jiaju+"按摩椅" +" "+ $(".jianshenqi3").val() + "、";
	}
	
	//鱼缸
	if( $(".yugang1").val()!=0 ){
		jiaju=jiaju+"长度80以下" +" "+ $(".yugang1").val() + "、";
	}
	
	if( $(".yugang2").val()!=0 ){
		jiaju=jiaju+"长度80-120" +" "+ $(".yugang2").val() + "、";
	}
	
	if( $(".yugang3").val()!=0 ){
		jiaju=jiaju+"长度120-160" +" "+ $(".yugang3").val() + "、";
	}
	
	if( $(".yugang4").val()!=0 ){
		jiaju=jiaju+"长度160以上" +" "+ $(".yugang4").val() + "、";
	}
	
	if( $(".yugang5").val()!=0 ){
		jiaju=jiaju+"异形鱼缸" +" "+ $(".yugang5").val() + "、";
	}

	//保险柜
	if( $(".baoxiangui1").val()!=0 ){
		jiaju=jiaju+"80CM以下" +" "+ $(".baoxiangui1").val() + "、";
	}
	
	if( $(".baoxiangui2").val()!=0 ){
		jiaju=jiaju+"80CM以上" +" "+ $(".baoxiangui2").val() + "、";
	}

	//装饰景观
	if( $(".zhuangshijingguan1").val()!=0 ){
		jiaju=jiaju+"大型盆景" +" "+ $(".zhuangshijingguan1").val() + "、";
	}
	
	if( $(".zhuangshijingguan2").val()!=0 ){
		jiaju=jiaju+"大型字画" +" "+ $(".zhuangshijingguan2").val() + "、";
	}
	
	if( $(".zhuangshijingguan3").val()!=0 ){
		jiaju=jiaju+"大花瓶" +" "+ $(".zhuangshijingguan3").val() + "、";
	}
	
	if( $(".zhuangshijingguan4").val()!=0 ){
		jiaju=jiaju+"景观石" +" "+ $(".zhuangshijingguan4").val() + "、";
	}
	
	$(".option-jj").val(jiaju);
	$("#page-select-dxl").hide();
	$("#page-home").fadeIn();
	
});